#include <stdio.h>

int main(int argc, char**argv)
{
    //打开文件
    FILE*fp = fopen(argv[1], "a+");
    if(fp == NULL)
    {
        perror("fopen error:");
        return -1;
    }

    //获取数据整理写入文件
    int count = 0;
    int sum_score = 0;
    while(1)
    {
        int num,score;
        char name[32] = {0};
        scanf("%d%s%d", &num, name, &score);
        if(num <= 0)
            break;
        sum_score += score;
        count++;
        fprintf(fp,"%d-HF240401 %d %s %d\n",count, num, name, score);
        
    }
    fprintf(fp,"平均分:%f\n",sum_score*1.0/count);


    fclose(fp);
}